package com.banch.cloud.common.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * common result for web page
 *
 * @author banch
 * @version 1.0
 * @date 2020/5/4
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class CommonResult<T> implements Serializable {

    /**
     * response code to web page
     */
    private Integer code;

    /**
     * message to web page
     */
    private String message;

    /**
     * data to web page
     */
    private T data;

    public static CommonResult getResult(Integer code, String message) {
        return new CommonResult(code, message, null);
    }

}